package toString;

import java.util.Objects;
class Human{
    public String id;
    public Human(String id){
        this.id = id;
    }
    @Override
    public boolean equals(Object obj){
        if(obj == null){//判断参数是否为空
            return false;
        }
        if(this == obj){//判断地址是否相等
            return true;
        }
       Human tmp = (Human)obj;
       return this.id.equals(tmp.id);
    }

}
public class Test{
    public static void main(String[] args){
        Object o1 = new Human("610");
        Object o2 = new Human("610");
        System.out.println(o1.equals(o2));
    }
}
